package com.atguigu.yygh.hosp.controller;

import com.atguigu.yygh.common.result.Result;
import com.atguigu.yygh.hosp.service.HospitalService;
import com.atguigu.yygh.model.hosp.Hospital;
import com.atguigu.yygh.vo.hosp.HospitalQueryVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("/admin/hosp/hospital")
public class HostpitalController {
    @Autowired
    HospitalService hospitalService;
    // 医院列表方法
    @GetMapping("/list/{page}/{limit}")
    public Result listHost(@PathVariable Integer page, @PathVariable Integer limit,HospitalQueryVo vo) {

        Page<Hospital> pageModel = hospitalService.selectHospPage(page,limit,vo);
        return Result.ok(pageModel);
    }
}
